```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JDBC 核心技术精讲</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        :root {
            --primary: #2563eb;
            --primary-light: #93c5fd;
            --secondary: #14b8a6;
            --dark: #1e293b;
            --light: #f8fafc;
            --code-bg: #f1f5f9;
        }
        body {
            font-family: 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
            color: var(--dark);
            line-height: 1.6;
            background-color: #f8fafc;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', Georgia, serif;
            font-weight: 600;
        }
        .hero {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        }
        .code-block {
            background-color: var(--code-bg);
            border-radius: 0.5rem;
            overflow-x: auto;
        }
        .card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .card:hover {
            transform: translateY(-4px);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        }
        .pill {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 500;
        }
        .mermaid-container {
            background-color: white;
            border-radius: 0.5rem;
            padding: 1.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero text-white py-20 px-4">
        <div class="max-w-4xl mx-auto text-center">
            <h1 class="text-5xl font-bold mb-6">JDBC 核心技术精讲</h1>
            <p class="text-xl mb-8 opacity-90">Java数据库连接技术全解析</p>
            <div class="inline-flex space-x-4">
                <div class="pill bg-white text-primary">Java技术</div>
                <div class="pill bg-white text-primary">数据库连接</div>
                <div class="pill bg-white text-primary">企业级开发</div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="max-w-6xl mx-auto px-4 py-12">
        <!-- JDBC Overview -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">JDBC概述</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-md p-6 card">
                    <h3 class="text-xl font-semibold mb-4 flex items-center">
                        <i class="fas fa-database text-primary mr-2"></i>JDBC定义
                    </h3>
                    <p class="text-gray-700 mb-4">JDBC (Java Database Connectivity) 是SUN公司提供的一套操作数据库的标准规范，它为Java程序提供了访问多种关系型数据库的统一接口。</p>
                    <p class="text-gray-700">JDBC与数据库驱动的关系是接口与实现的关系，驱动是各数据库厂商对JDBC接口的具体实现。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card">
                    <h3 class="text-xl font-semibold mb-4 flex items-center">
                        <i class="fas fa-project-diagram text-primary mr-2"></i>JDBC工作模式
                    </h3>
                    <div class="mermaid-container">
                        <div class="mermaid">
                            graph LR
                                A[Java Application] --> B[JDBC API]
                                B --> C[JDBC Driver Manager]
                                C --> D[Database Driver]
                                D --> E[Database]
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- JDBC Core Components -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">JDBC四大核心组件</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-6">
                <div class="bg-white rounded-xl shadow-md p-6 card">
                    <div class="text-4xl text-primary mb-4">
                        <i class="fas fa-plug"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">DriverManager</h3>
                    <p class="text-gray-700">用于注册和管理数据库驱动，建立与数据库的连接</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card">
                    <div class="text-4xl text-primary mb-4">
                        <i class="fas fa-link"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">Connection</h3>
                    <p class="text-gray-700">表示与数据库创建的连接对象，所有数据库操作的基础</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card">
                    <div class="text-4xl text-primary mb-4">
                        <i class="fas fa-terminal"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">Statement</h3>
                    <p class="text-gray-700">操作数据库SQL语句的对象，用于执行静态SQL语句</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card">
                    <div class="text-4xl text-primary mb-4">
                        <i class="fas fa-table"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">ResultSet</h3>
                    <p class="text-gray-700">SQL语句执行后返回的结果集，包含查询结果的数据</p>
                </div>
            </div>
        </section>

        <!-- JDBC Operation Steps -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">JDBC操作步骤</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6">
                    <ol class="list-decimal pl-6 space-y-4">
                        <li class="text-gray-700"><strong>加载驱动</strong> - 注册数据库驱动</li>
                        <li class="text-gray-700"><strong>创建连接对象</strong> - 建立与数据库的连接</li>
                        <li class="text-gray-700"><strong>创建Statement对象</strong> - 创建SQL语句执行对象</li>
                        <li class="text-gray-700"><strong>执行SQL语句</strong> - 执行增删改查操作</li>
                        <li class="text-gray-700"><strong>获取执行结果</strong> - 处理查询结果或影响行数</li>
                    </ol>
                </div>
                
                <div class="code-block p-4 bg-gray-50">
                    <pre><code class="text-sm">
// 加载驱动
Class.forName("com.mysql.jdbc.Driver");
// 创建连接对象
Connection connection = DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/lhp", "root", "123");
// 创建Statement对象
Statement statement = connection.createStatement();
// 通过Statement对象执行sql语句
String sql = "insert into student(name) values('hgz')";
int result = statement.executeUpdate(sql);
// 根据结果进行展示
if (result == 1) {
    System.out.println("添加成功！");
} else {
    System.out.println("添加失败");
}
                    </code></pre>
                </div>
            </div>
        </section>

        <!-- CRUD Operations -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">JDBC实现增删改查</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div>
                    <div class="bg-white rounded-xl shadow-md p-6 card h-full">
                        <h3 class="text-xl font-semibold mb-4">CRUD操作</h3>
                        <div class="mermaid-container">
                            <div class="mermaid">
                                graph TD
                                    A[Create] -->|INSERT| B(数据库)
                                    C[Read] -->|SELECT| B
                                    D[Update] -->|UPDATE| B
                                    E[Delete] -->|DELETE| B
                            </div>
                        </div>
                    </div>
                </div>
                
                <div>
                    <div class="bg-white rounded-xl shadow-md p-6 card h-full">
                        <h3 class="text-xl font-semibold mb-4">资源关闭</h3>
                        <p class="text-gray-700 mb-4"><strong>正确的资源关闭</strong>是JDBC编程中非常重要的一环，可以防止资源泄漏。</p>
                        <ul class="list-disc pl-6 space-y-2 text-gray-700">
                            <li>使用finally块确保资源被关闭</li>
                            <li>创建工具类封装关闭资源的方法</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- SQL Injection -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">SQL注入问题</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6">
                    <div class="flex items-start">
                        <div class="text-red-500 mr-4">
                            <i class="fas fa-exclamation-triangle text-2xl"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-2">SQL注入风险</h3>
                            <p class="text-gray-700 mb-4">直接拼接SQL语句会导致SQL注入漏洞，攻击者可以构造恶意输入改变SQL语义。</p>
                            <p class="text-gray-700"><strong>解决方案：</strong> 使用PreparedStatement预编译对象来防止SQL注入。</p>
                        </div>
                    </div>
                </div>
                
                <div class="border-t border-gray-200">
                    <div class="grid md:grid-cols-2">
                        <div class="p-6 border-r border-gray-200">
                            <h4 class="font-medium text-red-500 mb-2 flex items-center">
                                <i class="fas fa-times-circle mr-2"></i>不安全的方式
                            </h4>
                            <div class="code-block p-4 bg-gray-50">
                                <pre><code class="text-sm">
String sql = "SELECT * FROM users WHERE username='" 
           + username + "' AND password='" + password + "'";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
                                </code></pre>
                            </div>
                        </div>
                        
                        <div class="p-6">
                            <h4 class="font-medium text-green-500 mb-2 flex items-center">
                                <i class="fas fa-check-circle mr-2"></i>安全的方式
                            </h4>
                            <div class="code-block p-4 bg-gray-50">
                                <pre><code class="text-sm">
String sql = "SELECT * FROM users WHERE username=? AND password=?";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, username);
pstmt.setString(2, password);
ResultSet rs = pstmt.executeQuery();
                                </code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- MVC Design Pattern -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">MVC设计思想</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6">
                    <div class="flex items-start">
                        <div class="text-primary mr-4">
                            <i class="fas fa-layer-group text-2xl"></i>
                        </div>
                        <div>
                            <p class="text-gray-700 mb-4">MVC (Model-View-Controller) 是一种架构模式，将应用分为三个层级：模型层(Model)、视图层(View)和控制层(Controller)。各层职责分离，既相互独立又协同工作。</p>
                        </div>
                    </div>
                </div>
                
                <div class="border-t border-gray-200 p-6">
                    <div class="mermaid-container">
                        <div class="mermaid">
                            graph LR
                                U[User] -->|请求| C[Controller]
                                C -->|调用| M[Model]
                                M -->|返回数据| C
                                C -->|选择视图| V[View]
                                V -->|呈现| U
                        </div>
                    </div>
                    
                    <div class="grid md:grid-cols-3 gap-6 mt-8">
                        <div class="bg-gray-50 p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2">模型层(Model)</h4>
                            <p class="text-gray-700">业务数据的信息表示，关注支撑业务的信息构成</p>
                        </div>
                        <div class="bg-gray-50 p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2">视图层(View)</h4>
                            <p class="text-gray-700">为用户提供页面的展示，重点关注数据的展现</p>
                        </div>
                        <div class="bg-gray-50 p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2">控制层(Controller)</h4>
                            <p class="text-gray-700">接受用户请求，并调用相应的模型处理，最后通过视图展示</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Stored Procedures -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">JDBC调用存储过程</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-6">
                        <h3 class="text-xl font-semibold mb-4">调用IN参数存储过程</h3>
                        <div class="code-block p-4 bg-gray-50">
                            <pre><code class="text-sm">
// 设置要调用储存过程
proc = conn.prepareCall("{call pro1(?,?,?)}");

// 设置参数
proc.setInt(1, 20);
proc.setString(2, "马云");
proc.setInt(3, 50);

// 调用储存过程
proc.execute();
                            </code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-6">
                        <h3 class="text-xl font-semibold mb-4">调用OUT参数存储过程</h3>
                        <div class="code-block p-4 bg-gray-50">
                            <pre><code class="text-sm">
// 设置要调用储存过程
proc = conn.prepareCall("{call pro2(?,?)}");

// 设置参数
proc.setInt(1, 7369);
proc.registerOutParameter(2, Types.VARCHAR);

// 调用储存过程
proc.execute();

// 得到存储过程的输出参数值
System.out.println(proc.getString(2));
                            </code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- JDBC调用函数 -->
        <section>
            <div class="flex items-center mb-8">
                <div class="h-1 bg-primary flex-grow"></div>
                <h2 class="text-3xl font-bold px-4 text-gray-800">JDBC调用函数</h2>
                <div class="h-1 bg-primary flex-grow"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6">
                    <div class="code-block p-4 bg-gray-50">
                        <pre><code class="text-sm">
// 设置要调用的函数
proc = conn.prepareCall("{?=call fun1(?,?)}");

// 设置参数
proc.setInt(2, 23);
proc.setInt(3, 13);
proc.registerOutParameter(1, Types.INTEGER);

// 调用函数
proc.execute();

// 得到函数的返回值
System.out.println(proc.getInt(1));
                        </code></pre>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
            }
        });
        
        // Add hover effects to code blocks
        document.querySelectorAll('.code-block').forEach(block => {
            block.addEventListener('mouseenter', () => {
                block.querySelector('code').classList.add('text-primary');
            });
            block.addEventListener('mouseleave', () => {
                block.querySelector('code').classList.remove('text-primary');
            });
        });
    </script>
</body>
</html>
```